using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Demo : MonoBehaviour
{
    [SerializeField]private 人 主角;
    private User u;
    
    // Start is called before the first frame update
    void Start()
    {
        var v = 本地缓存值.Instance.GetValue(typeof(User).ToString());
        u = new User().解析(v);
        主角.SetName(u.name);
        主角.SetLevel(u.level);
    }


    [ContextMenu("测试保存")]
    public void Save()
    {
        u.level = 主角.GetLevel();
        u.name = 主角.GetName();
        本地缓存值.Instance.SaveValue(typeof(User).ToString(),u,true);
    }
}
